<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<tpl> $NCharset </tpl>" />
<title><tpl> $langCShopNCSystem </tpl></title>
<tpl>include file ='sys_head_config.html'</tpl>
</head>
<body>
<div class="tabbar">
  <ul class="tab_btns" id="COPYYH2">
    <li class="current"><a href="sqlback.manage.php?action=list"><span><tpl> $langSysSQLBackDatabase </tpl></span></a></li>
    <li><a href="javascript:;" onclick="ShowDiv='result_content';getPageContent('sqlback.manage.php?action=restore');ST(1,1);"><span><tpl> $langSysSQLRevertDatabase </tpl></span></a></li>
	<li><a href="javascript:;" onclick="ShowDiv='result_content';getPageContent('sqlback.manage.php?action=optimize_list');ST(2,2);"><span><tpl> $langSysSQLOptimizeDatabase </tpl></span></a></li>
  </ul>
	<div class="tab_notes" id="copyyh0">
		<ul class="notesbg block"><span><h4><tpl> $langSysSQLAssureServerDataSafety </tpl></h4></span></ul>
		<ul class="notesbg"><span><h4><tpl> $langSysSQLRevertBackDatabase </tpl></h4></span></ul>
		<ul class="notesbg"><span><h4><tpl> $langSysSQLDataTableOptimize </tpl></h4></span></ul>
	</div>
	<!-- 显示提示信息 -->
	<div id="message"></div>
	<!-- 显示提示信息end -->
</div>

<div id="product-help" class="admincp_form" style="top:88px;">
<div id="result_content">
	<form action="sqlback.manage.php" method="POST" id="form1" name="form1" onsubmit="return ajax_back();">
	<input type="hidden" name="action" value="backup" />
  <table  class="from_table2_one">
	<tr>
		<td colspan="5" class="td1">　<tpl> $langSysSQLSize </tpl>(KB)：<input name="vol_size" type="text" class="txtinput_short" value="1024" size="10"/>　
		  <tpl> $langSysSQLRemark </tpl>：<input name="vol_remark" type="text" class="txtinput_short" size="40"/>
		</td><td width="300">  <span class="btn_left">
		<input type="submit" value="<tpl> $langSysSQLBeginBack </tpl>" class="btn_submit" /></span></td>
	</tr>
  
	<tr style=" background:none;">
		<td colspan="5">
		<div style="float:left; padding-left:20px; padding-bottom:7px; padding-top:7px;">
		<span class="btn_left"><input  name="button" type="button" class="btn_submit" value="<tpl> $langSysSQLAllSelect </tpl>" onclick="selectall();" /></span>
		<span class="btn_left"><input name="button" type="button" class="btn_submit" value="<tpl> $langSysSQLContrarySelect </tpl>" onclick="negative();" /></span>
	　　</div>
	</td>
	<td></td>
	</tr>
    <tr class="area_ajax_list_title">
      <th class="pd-left" width="100"></th>
      <th width="300"><tpl> $langSysSQLTableName </tpl></th>
      <th width="200" class="th2"><tpl> $langSysSQLTableType </tpl></th>
      <th width="200" class="th2"><tpl> $langSysSQLNoteNum </tpl></th>
      <th width="200" class="th2"><tpl> $langCOperation </tpl></th>
	  <th></th>
    </tr>
	<tbody>
    <tpl> section name=i loop=$sql_array </tpl>
    <tr>
      <td class="pd-left" width="100"><input type="checkbox" name="sql_name[]" value="<tpl> $sql_array[i].Name </tpl>" checked/></td>
      <td width="300" class="td1"><tpl> $sql_array[i].Name </tpl></td>
      <td width="200"><tpl> $sql_array[i].Engine </tpl></td>
      <td width="200"><tpl> $sql_array[i].Rows </tpl></td>
      <td width="200"><a href="javascript:;" onclick="ShowDiv='result_content';getPageContent('sqlback.manage.php?action=info&name=<tpl> $sql_array[i].Name </tpl>');" title="<tpl> $langCview </tpl>SQL" class="view_a_pic">
        </a></td>
		<td></td>
    </tr>
    <tpl> /section </tpl>
   
	</tbody>
</table>
<div class="table-5-bottom">
<div class="p-left">
			<span class="btn_left"><input  name="button" type="button" class="btn_submit" value="<tpl> $langSysSQLAllSelect </tpl>" onclick="selectall();" /></span>
			<span class="btn_left"><input name="button" type="button" class="btn_submit" value="<tpl> $langSysSQLContrarySelect </tpl>" onclick="negative();" /></span>
	        <span class="btn_left"><input type="submit" class="btn_submit" value="<tpl> $langSysSQLBeginBack </tpl>" /></span>
			</div>
</div>
 </form>
</div>
</div>
<!-- 帮助菜单 -->
<tpl> include file='sys_right_help.html' </tpl>
<!-- 帮助菜单END -->
</body>
</html>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
	hideLoading();
});
//全选
function selectall(){
	$('#form1 input[@type=checkbox]').each(function(){
		$(this).attr('checked',!$(this).attr('checked'))
	})
}
//反选
function negative(){
	$('#form1 input[@type=checkbox]').each(function(){
		$(this).attr('checked',!$(this).attr('checked'))
	})
}


//备份数据库
function ajax_back(){
	var queryString=$("#form1").formSerialize();

	$.ajax({
		url: "sqlback.manage.php",
		data: queryString,
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showSaveText),
		success: function(msg){
					hideLoading();
					showMessage(msg.message,msg.type);
		}
	});
	return false;
}
</script>